import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;

public class GameJFrame extends JFrame {
    GameJFrame(){
        GameJPanel gameJPanel = new GameJPanel();
        // 设置窗口大小
        this.setSize(1550, 840);
        // 窗口位置
        this.setLocation(25, 20);
        // 是否显示窗口
        this.setVisible(true);
        // 设置关闭按钮的作用
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.add(gameJPanel);
        this.addKeyListener(gameJPanel);
        Thread thread = new Thread(gameJPanel);
        thread.start();
    }
}
